package com.iskny.framework.admin.controllor;

import com.jfinal.core.Controller;
import com.jfinal.validate.Validator;

public class MenuValidator extends Validator {

	@Override
	protected void validate(Controller c) {
		c.validateToken();
		validateRequired("menu.name", "name_info", "菜单名不能为空");
		validateLong("menu.state", "state_info", "菜单状态必须选择");
		validateLong("menu.sortnum", "sortnum_info", "菜单排序必须为整数");
	}

	@Override
	protected void handleError(Controller c) {
		c.keepPara();
		c.forwardAction("/admin/menu/edit/"+c.getPara("menu.id", ""));
	}

}
